import axios from "axios";
var chart_078dfb2cc1524938896b1621e1e0401f = echarts.init(
    document.getElementById('078dfb2cc1524938896b1621e1e0401f'), 'white', { renderer: 'canvas' });
var option_078dfb2cc1524938896b1621e1e0401f = {
    "animation": true,
    "animationThreshold": 2000,
    "animationDuration": 1000,
    "animationEasing": "cubicOut",
    "animationDelay": 0,
    "animationDurationUpdate": 300,
    "animationEasingUpdate": "cubicOut",
    "animationDelayUpdate": 0,
    "color": [
        "#c23531",
        "#2f4554",
        "#61a0a8",
        "#d48265",
        "#749f83",
        "#ca8622",
        "#bda29a",
        "#6e7074",
        "#546570",
        "#c4ccd3",
        "#f05b72",
        "#ef5b9c",
        "#f47920",
        "#905a3d",
        "#fab27b",
        "#2a5caa",
        "#444693",
        "#726930",
        "#b2d235",
        "#6d8346",
        "#ac6767",
        "#1d953f",
        "#6950a1",
        "#918597"
    ],
    "series": [
        {
            "type": "bar3D",
            "data": [
                [
                    1,
                    2,
                    8576
                ],
                [
                    1,
                    1,
                    3000
                ],
                [
                    1,
                    3,
                    10970
                ],
                [
                    1,
                    4,
                    16833
                ],
                [
                    1,
                    0,
                    5050
                ],
                [
                    0,
                    2,
                    8250
                ],
                [
                    0,
                    3,
                    10666
                ],
                [
                    0,
                    4,
                    37500
                ],
                [
                    0,
                    0,
                    14500
                ],
                [
                    2,
                    2,
                    11358
                ],
                [
                    2,
                    1,
                    12000
                ],
                [
                    2,
                    3,
                    16105
                ],
                [
                    2,
                    4,
                    24540
                ],
                [
                    2,
                    0,
                    14933
                ],
                [
                    3,
                    2,
                    16000
                ],
                [
                    3,
                    3,
                    22500
                ]
            ],
            "label": {
                "show": false,
                "position": "top",
                "margin": 8
            }
        }
    ],
    "legend": [
        {
            "data": [
                ""
            ],
            "selected": {},
            "show": true,
            "padding": 5,
            "itemGap": 10,
            "itemWidth": 25,
            "itemHeight": 14
        }
    ],
    "tooltip": {
        "show": true,
        "trigger": "item",
        "triggerOn": "mousemove|click",
        "axisPointer": {
            "type": "line"
        },
        "showContent": true,
        "alwaysShowContent": false,
        "showDelay": 0,
        "hideDelay": 100,
        "textStyle": {
            "fontSize": 14
        },
        "borderWidth": 0,
        "padding": 5
    },
    "visualMap": {
        "show": false,
        "type": "continuous",
        "min": 0,
        "max": 30000,
        "inRange": {
            "color": [
                "#313695",
                "#4575b4",
                "#74add1",
                "#abd9e9",
                "#e0f3f8",
                "#ffffbf",
                "#fee090",
                "#fdae61",
                "#f46d43",
                "#d73027",
                "#a50026"
            ]
        },
        "calculable": true,
        "inverse": false,
        "splitNumber": 5,
        "orient": "vertical",
        "showLabel": true,
        "itemWidth": 20,
        "itemHeight": 140,
        "borderWidth": 0
    },
    "xAxis3D": {
        "data": [
            "\u5b66\u5386\u4e0d\u9650",
            "\u5927\u4e13",
            "\u672c\u79d1",
            "\u7855\u58eb"
        ],
        "name": " ",
        "nameGap": 20,
        "type": "category",
        "axisLine": { "show": true, "onZero": true, "onZeroAxisIndex": 0, "lineStyle": { "show": true, "width": 2, "opacity": 1, "curveness": 0, "type": "solid", "color": "#d4d4d4" } }, "axisLabel": { "margin": 8, "color": "#d4d4d4" }
    },
    "yAxis3D": {
        "data": [
            "\u7ecf\u9a8c\u4e0d\u9650",
            "1\u5e74\u4ee5\u5185",
            "1-3\u5e74",
            "3-5\u5e74",
            "5-10\u5e74"
        ],
        "name": " ",
        "nameGap": 20,
        "type": "category",
        "axisLine": { "show": true, "onZero": true, "onZeroAxisIndex": 0, "lineStyle": { "show": true, "width": 2, "opacity": 1, "curveness": 0, "type": "solid", "color": "#d4d4d4" } }, "axisLabel": { "margin": 8, "color": "#d4d4d4" }
    },
    "zAxis3D": {
        "name": " ",
        "nameGap": 20,
        "type": "value",
        "axisLine": { "show": true, "onZero": true, "onZeroAxisIndex": 0, "lineStyle": { "show": true, "width": 2, "opacity": 1, "curveness": 0, "type": "solid", "color": "#d4d4d4" } }, "axisLabel": { "margin": 8, "color": "#d4d4d4" }
    },
    "grid3D": {
        "boxWidth": 80,
        "boxHeight": 100,
        "boxDepth": 80,
        "viewControl": {
            "autoRotate": true,
            "autoRotateSpeed": 5,
            "rotateSensitivity": 1
        }
    },
    "title": [
        {
            "text": "·学历/经验/薪资",
            "top": 5,
            "padding": 5,
            "itemGap": 10,
            "textStyle": {
                "color": "#d4d4d4",
                "fontWeight": "normal",
                "fontFamily": "\u534e\u6587\u7ec6\u9ed1",
                "fontSize": 18
            }
        }
    ]
};
chart_078dfb2cc1524938896b1621e1e0401f.setOption(option_078dfb2cc1524938896b1621e1e0401f);
window.addEventListener('resize', function () {
    chart_078dfb2cc1524938896b1621e1e0401f.resize();
})

export const get3DBarData = (city) => {
    axios
        .get(city + '/3DBar')
        .then(function (response) {
            var data = response.data
            option_078dfb2cc1524938896b1621e1e0401f.xAxis3D.data = data[0]
            option_078dfb2cc1524938896b1621e1e0401f.yAxis3D.data = data[1]
            option_078dfb2cc1524938896b1621e1e0401f.series[0].data = data[2]

            chart_078dfb2cc1524938896b1621e1e0401f.setOption(option_078dfb2cc1524938896b1621e1e0401f);
            window.addEventListener('resize', function () {
                chart_078dfb2cc1524938896b1621e1e0401f.resize();
            })
        })
        .catch(function (error) { // 请求失败处理
            console.log(error);
        })
}